﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
    mc:Ignorable="d"
	x:Class="MVVM_CAD.SaveFileDialog"
	x:Name="UserControl"
	d:DesignWidth="261.377" Width="262" Height="125">
    
    
    <UserControl.DataContext>
        <Binding Path="Main.SceneManagerViewModel" Source="{StaticResource Locator}"/>
    </UserControl.DataContext>

    <UserControl.Resources>
    	<Style x:Key="ToolButton" TargetType="{x:Type Button}">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<Grid>
    						<i:Interaction.Triggers>
    							<i:EventTrigger EventName="MouseLeave">
    								<ei:GoToStateAction x:Name="OnMouseLeaveForButton" StateName="OnMouseLeave"/>
    							</i:EventTrigger>
    							<i:EventTrigger EventName="MouseEnter">
    								<ei:GoToStateAction x:Name="OnMouseEnterForButton" StateName="OnMouseOver"/>
    							</i:EventTrigger>
    						</i:Interaction.Triggers>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="ButtonMouseOver">
    								<VisualStateGroup.Transitions>
    									<VisualTransition GeneratedDuration="0:0:0.2"/>
    								</VisualStateGroup.Transitions>
    								<VisualState x:Name="OnMouseLeave">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
    											<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="OnMouseOver">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
    											<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    										</ObjectAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
    											<EasingDoubleKeyFrame KeyTime="0" Value="0.275"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Rectangle Fill="#FF838383" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C"/>
    						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    						<Rectangle x:Name="rectangle" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C" Opacity="0" Visibility="Visible">
    							<Rectangle.Fill>
    								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    									<GradientStop Color="Black" Offset="0.151"/>
    									<GradientStop Color="White" Offset="1"/>
    									<GradientStop Color="White" Offset="1"/>
    								</LinearGradientBrush>
    							</Rectangle.Fill>
    						</Rectangle>
    					</Grid>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsFocused" Value="True"/>
    						<Trigger Property="IsDefaulted" Value="True"/>
    						<Trigger Property="IsMouseOver" Value="True"/>
    						<Trigger Property="IsPressed" Value="True"/>
    						<Trigger Property="IsEnabled" Value="False"/>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Margin="0,2,0,0" Width="262" Height="123">
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="Display">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.5">
						<VisualTransition.GeneratedEasingFunction>
							<CubicEase EasingMode="EaseIn"/>
						</VisualTransition.GeneratedEasingFunction>
					</VisualTransition>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="DisplayOn">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UserControl">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="DisplayOff">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UserControl">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
							<DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value="{x:Static Visibility.Hidden}"/>
						</ObjectAnimationUsingKeyFrames>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="UserControl">
							<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid Margin="0,29,0,-3" Width="262" Height="97">
			<i:Interaction.Triggers>
				<i:EventTrigger>
					<ei:GoToStateAction x:Name="DisplayOffSave" StateName="DisplayOff"/>
				</i:EventTrigger>
				<ei:DataStoreChangedTrigger Binding="{Binding HardCoded}">
					<ei:GoToStateAction x:Name="DisplayOnSave" StateName="DisplayOn"/>
				</ei:DataStoreChangedTrigger>
			</i:Interaction.Triggers>
			<Rectangle x:Name="rectangle" Fill="#FF3D3D3D" RadiusY="5" RadiusX="5" Stroke="#FF959595" StrokeThickness="5" Margin="-1,-3,2.377,3"/>
			<Label x:Name="label1" Content="Nombre del archivo" Foreground="#FFCFCBCB" Margin="15,15.999,0,0" HorizontalAlignment="Left" Width="115.333" Height="23.333" VerticalAlignment="Top"/>
			<TextBox x:Name="textBox1" HorizontalAlignment="Right" Margin="0,16.006,15.377,0" TextWrapping="Wrap" Width="107.333" Text="{Binding FileName}" Height="20.667" VerticalAlignment="Top"/>
			<Button x:Name="button" Content="Guardar" Margin="94.321,0,96.968,14.889" Style="{DynamicResource ToolButton}" Command="{Binding SaveToFileToolCommand, Mode=OneWay}" Height="27.333" VerticalAlignment="Bottom">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<ei:GoToStateAction StateName="DisplayOff"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>
			<Label x:Name="label2" Content="Cerrar" HorizontalAlignment="Right" Height="25" Margin="0,0,0,0.477" VerticalAlignment="Bottom" Width="44" Foreground="#FFABA6A6" FontSize="9.333">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="MouseLeftButtonDown">
						<ei:GoToStateAction x:Name="CloseProperties" StateName="DisplayOff"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Label>
		</Grid>
	</Grid>
</UserControl>